package com.zb.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zb.annotation.NumberPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Date;
import java.util.List;


/**
 * @Author WEN
 * @Date 2023/9/20 0020
 **/
@Data
@ApiModel("创建工单对象")
public class OrderVo {
    @ApiModelProperty(value = "工单ID，新增不必传，修改必传")
    private Long id;

    @ApiModelProperty(value = "工单ID列表")
    private List<Long> idList;

    @NotNull(message = "品牌商家不能为空")
    @ApiModelProperty(value = "品牌商家ID", required = true)
    private Long factoryId;

    @NotNull(message = "工单模块不能为空")
    @ApiModelProperty(value = "工单模块ID", required = true)
    private Long moduleId;

    @ApiModelProperty(value = "收取客户费用")
    private BigDecimal collectCustomerPrice;

    @ApiModelProperty(value = "人员表ID，即客服ID，0表示按规则分配客服", example = "0")
    private Long empId;

    @ApiModelProperty(value = "网点表ID")
    private Long networkId;

    @NotNull(message = "质保状态不能为空")
    @ApiModelProperty(value = "质保状态，是否保外：false-保内，true-保外", required = true, example = "false")
    private Boolean overinsured;

    @NotNull(message = "工单来源不能为空")
    @NumberPattern(regexp = "^(1|2|3|4|5|6|7)$", message = "工单来源参数类型不合法")
    @ApiModelProperty(value = "工单来源有：1-平台系统报单，2-扫码报单，3-小程序报单，4-APP报单，5-Excel导入报单，6-品牌商家建单，7-平台代商家报单", required = true, example = "1")
    private Integer source;

    @ApiModelProperty(value = "工单级别ID")
    private Long workLevelId;

    @ApiModelProperty(value = "工单模块分类ID1")
    private Long oneTypeId;

    @ApiModelProperty(value = "工单模块分类ID2")
    private Long twoTypeId;

    @ApiModelProperty(value = "工单模块分类ID3")
    private Long threeTypeId;

    @ApiModelProperty(value = "工单模块方式ID1")
    private Long oneWayId;

    @ApiModelProperty(value = "工单模块方式ID2")
    private Long twoWayId;

    @ApiModelProperty(value = "工单模块方式ID3")
    private Long threeWayId;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "期望上门日期", hidden = true)
    private Date expectedDate;

    @JsonFormat(pattern = "HH:mm")
    @ApiModelProperty(value = "期望开始上门时间", hidden = true)
    private Date expectedStartTime;

    @JsonFormat(pattern = "HH:mm")
    @ApiModelProperty(value = "期望开始上门时间", hidden = true)
    private Date expectedEndTime;

    @Length(max = 1000, message = "故障描述长度限制 1000 个字符以内")
    @ApiModelProperty(value = "故障描述", example = "")
    private String content;

    @ApiModelProperty(value = "收取客户费用凭证")
    private String collectCustomerPriceVoucher;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = "报单时间")
    private Date createTime;

    @ApiModelProperty(value = "工单附件")
    private List<OrderImageVo> imageVos;

    @ApiModelProperty(value = "删除的工单附件ID集合")
    private List<Long> delImageIds;

    @Valid
    @ApiModelProperty(value = "工单客户对象")
    private OrderUserVo orderUser;

    @Valid
    @ApiModelProperty(value = "工单商品类型对象")
    private List<OrderGoodsTypeVo> orderGoodsTypes;

    @ApiModelProperty(value = "删除的工单商品对象ID集合")
    private List<Long> delOrderGoodsIds;

    @Valid
    @ApiModelProperty(value = "工单自定义字段值对象")
    private List<WorkFieldValVo> workFieldVal;

    @ApiModelProperty(value = "分机号")
    private String extensionNbr;

    @ApiModelProperty(value = "客户名称")
    private String contacts;

    @ApiModelProperty(value = "客户手机")
    private String contactsPhone;

    @ApiModelProperty(value = "省份")
    private String province;

    @ApiModelProperty(value = "城市")
    private String city;

    @ApiModelProperty(value = "镇区")
    private String area;

    @ApiModelProperty(value = "详细地址")
    private String address;

    @ApiModelProperty(value = "是否暂挂")
    private Integer isPause;

    @ApiModelProperty(value = "是否退回单")
    private Integer isReturn;

    @ApiModelProperty(value = "快递公司：1.顺丰 2.圆通 3.中通 4.申通 5.韵达 6.京东 7.邮政 8.极兔 9.德邦 10.百世")
    private Integer expressCompany;

    @ApiModelProperty(value = "快递单号")
    private String expressNbr;
}
